package com.zjitc;

import com.zjitc.obj.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
      ApplicationContext context = new ClassPathXmlApplicationContext("demo1.xml");
      User user = context.getBean("u1", User.class);
      User u1 = context.getBean("u1",User.class);


      User cuser = context.getBean("cuser", User.class);
      System.out.println(cuser);


      User IUser = context.getBean("Iuser",User.class);

        System.out.println(IUser);
      //if (!user.equals(u1)) { System.out.println("user != u1"); }
      //
      //System.out.println(user);
      //System.out.println(u2);

      ((ClassPathXmlApplicationContext)context).close();
    }
}
